import java.awt.Color;
import java.io.Serializable;

/**
 * EdgeAttr represents an edge with attributes weight and color. Objects of 
 * EdgeAttr can be saved through serialization.
 *
 * @version 1.0
 * @author K.Vamsi Krishna
 * @author P.Jaya Krishna
 */
public class EdgeAttr implements Serializable
{
	// weight/capacity of the edge
	private int weight;
	// color of the edge
	private Color color;
	// width of the edge
	private int width;
	
	/**
	 * used for default edge color, indicates a dark blue
	 */
	public static final Color COLOR_DEFAULT = new Color(2,105,255);
	
	/**
	 * Creates an EdgeAttr object with default values weight = 1 color = EdgeAttr.COLOR_DEFAULT.
	 */
	public EdgeAttr()
	{
		weight = 1;
		color = EdgeAttr.COLOR_DEFAULT;
		width = 1;
	}
	
	/**
	 * Creates an EdgeAttr object with specified weight and color = EdgeAttr.COLOR_DEFAULT.
	 */
	public EdgeAttr(int weight)
	{
		this.weight = weight;
		color = EdgeAttr.COLOR_DEFAULT;
		width = 1;
	}
	
	/**
	 * Creates an EdgeAttr object with specified weight and color.
	 */
	public EdgeAttr(int weight, Color color)
	{
		this.weight = weight;
		this.color = color;
		width = 1;
	}
	
	/**
	 * Creates a copy of the specified EdgeAttr object.
	 */
	public EdgeAttr(EdgeAttr ea)
	{
		weight = ea.weight;
		color = ea.color;
		width = ea.width;
	}
	
	/**
	 * Sets the edge weight to a new weight.
	 */
	public void setWeight(int weight)
	{
		this.weight = weight;
	}
	
	/**
	 * Sets the edge color to a new color.
	 */
	public void setColor(Color color)
	{
		this.color = color;
	}
	
	/**
	 * Sets the edge width to a new width.
	 */
	public void setWidth(int width)
	{
		this.width = width;
	}
	
	/**
	 * Returns the weight of the edge.
	 */
	public int getWeight()
	{
		return weight;
	}
	
	/**
	 * Returns the color of the edge.
	 */
	public Color getColor()
	{
		return color;
	}
	
	/**
	 * Returns the width of the edge.
	 */
	public int getWidth()
	{
		return width;
	}
}